package com.tianji.api.client.remark.fallback;

import com.tianji.api.client.remark.RemarkClient;
import com.tianji.api.dto.remark.LikeRecordFormDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

@Slf4j
public class RemarkClientFallback implements FallbackFactory<RemarkClient> {

    @Override
    public RemarkClient create(Throwable cause) {
        log.error("访问点赞服务异常", cause);
        return new RemarkClient() {
            @Override
            public void addLikeRecord(LikeRecordFormDTO recordDTO) {
                System.err.println("被降级了");
            }
        };
    }
}
